package com.uzai.common.enums;

/**
 * @Auther: xiaoyuexl
 * @Date: 2023/8/3 14:04
 * @Description: 朋友圈附件类型
 */
public enum AttachTypeEnum {
    LINK(0,"链接"),
    PICTURE(2,"图片"),
    SHORTVIDEO(3,"短视频"),
    LONGVIDEO(4,"长视频 与ShortVideo相同，不区分长短视频"),
    SHIPINHAO(5,"视频号");


    private Integer value;
    private String desc;

    AttachTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
    public static AttachTypeEnum getById(int id) {
        for (AttachTypeEnum type: AttachTypeEnum.values()) {
            if (type.getValue() == id) {
                return type;
            }
        }
        return null;
    }
}
